/**
 * 游戏通用的消息
 */
const tool = require('ToolUtil');
module.exports = {
    PortoMsg: "message ruleconfig{" +
        "    required int32 turn = 1;" +
        "    optional int32 playnums = 2 [default = 4];" +
        "    optional int32 scoretype = 3; " +
        "    optional int32 birdtype = 4; " +
        "    optional int32 hutype = 5;  " +
        "    optional bool isPiao = 7; " +
        "    optional bool isRandom = 8 [default = false];" +
        "    optional bool isKan3Pei = 9 [default = false];" +
        "    optional int32 gametype = 10;   " +
        "    optional int32 type = 11 [default = 0];" +
        "    optional int32 flag = 12 [default = 0];" +
        "    optional int32 readytimeout = 13 [default = 0];" +
        "    optional int32 optimeout = 14 [default = 0];" +

        "     " +
        "} " +

        "message cpgitem {" +
        "  required int32 card = 1;" +
        "  required int32 first = 2;" +
        "  required int32 type = 3;" +
        "}" +



        "message recordinfo {" +
        "  required ruleconfig config = 1;" +
        "  optional int32 tid = 2;" +
        "  optional int32 matchid = 3;" +
        "  repeated recordplayer playinfo = 4;" +
        "  optional int32 gameid = 5; " +
        "}" +


        "message player{" +
        "    required int32 id = 1;" +
        "    required int32 gold = 2;" +
        "    required int32 point = 3; " +
        "    repeated cpgitem cpg = 4;" +
        "    repeated int32 outcard = 5;" +
        "    optional bool offline = 6;" +
        "    repeated int32 handcard = 7;" +
        "    optional int32 cardcount = 8;" +
        "    optional int32 piao = 9;" +
        "    optional bool ready = 10 [default = false];" +
        "}" +

        "message balanceItem {" +
        "    required int32 id = 1;" +
        "    required int32 score = 2;" +
        "    required int32 hufan = 3;" +
        "    optional int32 hutype = 4; " +
        "    optional int32 starthutype = 5;  " +
        "    repeated int32 hucards = 6;" +
        "    optional bool istop = 7 [default = false];" +
        "    optional int32 starthuscore = 8 [default = -1];" +
        "    optional int32 huscore = 9 [default = -1];" +
        "}" +


        "message gameoverItem {" +
        "  message huType {" +
        "    required int32 type = 1; " +
        "    required int32 nums = 2;" +
        "  }  " +
        "    required int32 id = 1;" +
        "    required int32 gold = 2;" +
        "    required int32 point = 3;" +
        "    required int32 zimo = 4;" +
        "    required int32 pao = 5;" +
        "    required int32 huNums = 6;" +
        "    required int32 startHus = 7;   " +
        "    required int32 mingtang = 8;   " +
        "    required int32 gang = 9;   " +
        "    required int32 angang = 10;    " +
        "    repeated huType startHuMap = 11;    " +
        "    repeated huType huMap = 12;    " +
        "}" +

        "message CSCREATEROOM {" +
        "  optional ruleconfig config = 1;" +
        "  optional string ticket = 2;" +
        "}" +

        "message MYTABLE {" +
        "  required ruleconfig config = 1;" +
        "  required int32 tid = 2;" +
        "  optional int32 state = 3;" +
        "  optional int32 createTime = 4;" +
        "}" +

        "message SCRULE {" +
        "  required ruleconfig config = 1;" +
        "  required int32 tid = 2;" +
        "  optional int32 maker = 3;" +
        "  optional int32 matchid = 4;" +
        "  optional int32 gameid = 5; " +
        "}" +


        "message SCSTARTHU{" +
        "  required int32 id = 1;" +
        "  required int32 type = 2;" +
        "  repeated int32 card = 3;" +
        "}" +

        "message SCRECONNECT {" +
        "  required int32 state = 1;" +
        "  required ruleconfig config = 2;" +
        "  optional int32 maker = 3;" +
        "  optional int32 matchid = 4;" +
        "  optional int32 tid = 5;" +
        "  optional int32 cards = 6;" +
        "  optional int32 bankId = 7;" +
        "  optional int32 turnId = 8;" +
        "  optional int32 curPlayer = 9;" +
        "  optional int32 lastcoutcard = 10;" +
        "  optional int32 lastPlayerID = 11; " +
        "  repeated player player = 12;" +
        "  optional vote vote = 13; " +
        "  optional int32 handcard = 14; " +
        "}" +

        "message SCRANDOM{" +
        "    repeated int32 oldPld = 1;" +
        "    repeated int32 newPld = 2;" +
        "  }" +

        "message SCPIAO{" +
        " optional int32 id = 1 [default = -1];" +
        " optional int32 piao = 2 [default = -1];" +
        "}" +

        "message CSPIAO{" +
        " required int32 piao = 1;" +
        "}" +

        "message GAMESTART {" +
        "  optional int32 bankId = 1;" +
        "  required int32 turnId = 2;" +
        "  required int32 cards = 3;" +
        "  repeated player player = 4; " +
        "}" +

        "message BANKERCARD {" +
        "  required int32 card = 1; " +
        "}" +

        "message SCGETCARD{" +
        "  required int32 id = 1; " +
        "  optional int32 card = 2; " +
        "}" +
        " " +
        "message SCOUTCARD {" +
        "  required int32 id = 1; " +
        "  optional int32 card = 2; " +
        "}" +

        "message CSOUTCARD {" +
        "  required int32 card = 1;  " +
        "}" +

        "message SCEAT {" +
        "  required int32 id = 1;  " +
        "  required cpgitem card = 2;" +
        "}" +

        "message CSEAT {" +
        "  required int32 type = 1;   " +
        "  required int32 msid = 2;" +
        "  required int32 card = 3;" +
        "}" +
        " " +
        "message SCQUESTEAT {" +
        "  message eatItem {" +
        "    required int32 card = 1; " +
        "    required int32 first = 2;" +
        "  }  " +

        "  message cardItem {" +
        "    required int32 type = 1; " +
        "    repeated int32 card = 2;" +
        "  }  " +

        "  required int32 id = 1;   " +
        "  required int32 type = 2; " +
        "  optional int32 msid = 3;" +
        "  repeated eatItem eatarr =4; " +
        "  repeated cardItem carditem =5; " +
        "}" +
        " " +
        " " +

        "message SHOWHAIDICARD{" +
        "  required int32 card = 1;" +
        "}" +

        "message SCCALLHU {" +
        "  required int32 id = 1;" +
        "  required int32 type = 2;" +
        "  required int32 huCard = 3;" +
        "  repeated cpgitem huhands = 4;" +
        "  repeated cpgitem cpg = 5; " +
        "}" +

        "message SCBIRD{" +
        "    message birdinfo {" +
        "      required int32 card = 1; " +
        "      required bool hit = 2;" +
        "      required int32 id = 3;" +
        "    }  " +
        "   repeated birdinfo birds = 1;" +
        "}" +

        "message SCSHOWCARDS{" +
        "  required int32 id  = 1;" +
        "  required int32 flag = 2;" +
        "  repeated int32 hands = 3;" +
        "  repeated cpgitem cpg = 4; " +
        "}" +


        "message SCBALANCE {" +
        "  required int32 cur = 1; " +
        "  required uint32 time = 2;" +
        "  optional int32 banker = 3;" +
        "  required int32 pao = 4 [default = -1];" +
        "  repeated balanceItem player = 6; " +
        "  optional int32 haidi = 7 [default = -1];" +
        "  optional int32 peiId = 8 [default = -1];" +
        "  optional bool goldBird = 9 [default = false];" +
        "}" +

        "message SCGAMEOVER {" +
        "  required int64 time = 1;" +
        "  required int64 over = 2;" +
        "  optional bool isdestory = 3;" +
        "  repeated gameoverItem player = 4;" +
        "  optional int32 turn = 5;" +
        "}",

    PacketInfo: [{
            name: 'SCRULE', //规则
            block: true
        },
        {
            name: 'SCPIAO', //漂
            block: true
        },
        {
            name: 'CSPIAO' //
        },
        {
            name: 'SCRANDOM', //随机换位
            block: true
        },
        {
            name: 'SCRECONNECT', //断线重连
            block: true
        },
        {
            name: 'GAMESTART', //游戏开始数据包   直接发牌过去了
            block: true
        },
        {
            name: 'SCSTARTHU', //起手胡
            block: true
        },
        {
            name: 'SCGETCARD', //玩家摸牌
            block: true
        },
        {
            name: 'SCOUTCARD', //服务器通知玩家出牌
            block: true
        },
        {
            name: 'CSOUTCARD' //客户端发送消息
        },
        {
            name: 'SCEAT', //有人吃碰杠 已经有吃了
            block: true
        },
        {
            name: 'CSEAT'
        },
        {
            name: 'SCQUESTEAT', //徇问是否吃碰等情况 
            block: true
        },
        {
            name: 'SCCALLHU', //叫胡
            block: true
        },
        {
            name: 'SCBIRD', //中鸟
            block: true
        },
        {
            name: 'SCSHOWCARDS', //显牌
            block: true
        },
        {
            name: 'SHOWHAIDICARD', //显牌
            block: true
        },
        {
            name: 'SCBALANCE', //显牌
            block: true
        },
        {
            name: 'SCGAMEOVER', //显牌
            block: true
        }
    ]

};